package com.imooc.ecommerce.feign;

import com.imooc.ecommerce.common.TableId;
import com.imooc.ecommerce.feign.hystrix.GoodsClientHystrix;
import com.imooc.ecommerce.goods.SimpleGoodsInfo;
import com.imooc.ecommerce.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 安全的商品服务 Feign接口定义
 * @author zhangshao
 * @since 2023/12/13 23:40
 */
@FeignClient(contextId = "SecuredGoodsClient",value = "e-commerce-goods-service",fallback = GoodsClientHystrix.class)
public interface SecuredGoodsClient {
    /**
     * 根据ids查询简单商品信息
     * @param tableId
     * @return
     */
    @RequestMapping(value = "/ecommerce-goods-service/goods/simple-goods-info",method = RequestMethod.POST)
    CommonResponse<List<SimpleGoodsInfo>> getSimpleGoodsInfoByTableId(@RequestBody TableId tableId);
}
